// Copyright (C) 2025 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

@import "./query_builder/builder.scss";
@import "./query_builder/data_explorer.scss";

.pf-explore-page {
  --pf-exp-font-size-sm: 0.9em;
  --pf-exp-font-size-md: 1.1em;
  --pf-exp-font-size-lg: 1.8em;

  height: 100%;
  position: relative;
  overflow: auto;
  padding: 0.25rem;

  &__header {
    display: flex;
    align-items: center;
  }
}

// Styles for node documentation (loaded from markdown)
.pf-node-info {
  line-height: 1.6;

  h1 {
    font-size: 1.5em;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--pf-color-border);
    padding-bottom: 0.5rem;
  }

  h2 {
    font-size: 1.2em;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
  }

  h3 {
    font-size: 1.1em;
    font-weight: 600;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
  }

  p {
    margin-top: 0;
    margin-bottom: 1rem;
  }

  strong {
    font-weight: 600;
  }

  code {
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-family: var(--monospace-font);
    font-size: 0.9em;
  }

  pre {
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    margin: 1rem 0;

    code {
      padding: 0;
    }
  }

  ul,
  ol {
    margin: 0.5rem 0 1rem 1.5rem;
    padding-left: 0;
  }

  li {
    margin-bottom: 0.25rem;
  }

  &-loading {
    font-style: italic;
  }

  &-error {
    color: var(--pf-color-danger);
  }
}

// Table source specific styling
.pf-table-source-selected {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 2px solid var(--pf-color-border);

  h2 {
    font-size: 1.2em;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 1rem;
  }

  .pf-details-box {
    padding: 1rem;
    border-radius: 4px;
    border: 1px solid var(--pf-color-border);
  }
}

// Time range source specific styling
.pf-timerange-current-data {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 2px solid var(--pf-color-border);

  h2 {
    font-size: 1.2em;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 1rem;
  }

  .pf-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;

    th,
    td {
      padding: 0.5rem;
      text-align: left;
      border: 1px solid var(--pf-color-border);
    }

    th {
      font-weight: 600;
    }
  }

  .pf-timerange-info-mode {
    font-style: italic;
    margin-top: 0.5rem;
  }
}
